﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ModelLayer
{
    public class Cinema
    {
        private int id;
        private string name;
        private string address;

        public Cinema(string name, string address)
        {
            this.name = name;
            this.address = address;
        }

        public Cinema(int id, string name, string address)
        {
            this.id = id;
            this.name = name;
            this.address = address;
        }

        public override string ToString()
        {
            return this.name;
        }

        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public string Address
        {
            get { return address; }
            set { address = value; }
        }

        // override object.Equals
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return false;
            }

            Cinema c = (Cinema) obj;
            

            return
                this.Address.Equals(c.Address) &&
                this.Id.Equals(c.Id) &&
                this.Name.Equals(c.Name);
        }
    }
}
